﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XiaLastorm.Sharpshooter
{
	/// <summary>
	/// 一对一聊天消息
	/// </summary>
	[Serializable]
	public class ChatMessage : UserToUserMessage
	{
		/// <summary>
		/// 聊天内容
		/// </summary>
		public byte[] Content { get; set; }
		/// <summary>
		/// 生成 <see cref="ChatMessage"/> class 的新实例。
		/// </summary>
		/// <param name="from">发送用户</param>
		/// <param name="to">接收用户</param>
		/// <param name="content">聊天内容</param>
		public ChatMessage(User from, User to, byte[] content)
			: base(from, to)
		{
			if (content == null)
				throw new ArgumentNullException("content");
			Content = content;
		}

		public override string ToString()
		{
			return string.Format("{0} -> {1} : {2}", From, To, Content);
		}
	}
}
